Start
init -5 python: #custom bar ----------------------- style.my_bar = Style(style.default) style.my_bar.xalign = 0.5 style.my_bar.xmaximum = 315 # bar width style.my_bar.ymaximum = 30 # bar height style.my_bar.left_gutter = 5 style.my_bar.right_gutter = 5 # I have all my User Interface graphics stored in one file called ui. # To access them in my code, I put ui/ in front of all images in that file. style.my_bar.left_bar = Frame("ui/bar_full.png", 0, 0) style.my_bar.right_bar = Frame("ui/bar_empty.png", 0, 0) style.my_bar.hover_left_bar = Frame("ui/bar_hover.png", 0, 0) style.my_bar.thumb = "ui/thumb.png" style.my_bar.thumb_shadow = None style.my_bar.thumb_offset = 5 init -2 python: strenght = 5 inteligence = 5 constitution = 5 charisma = 5 dexterity = 5 max_HP = constitution*10 HP = max_HP dice = 3 monster_strenght = 0 monster_inteligence = 0 monster_constitution = 0 monster_charisma = 0 monster_dexterity = 0 monster_max_HP = 0 monster_HP = 0 monster_dice = 0 init -1: image monster_idle1: "characters/monster_slime1.png" 0.2 "characters/monster_slime2.png" 0.2 "characters/monster_slime3.png" 0.2 "characters/monster_slime2.png" 0.2 repeat image monster_attack1: "characters/monster_slime1.png" 2.0 "characters/monster_slime5.png" 0.1 #Move forward #Move backwards again 0.2 "characters/monster_slime1.png" 0.1 image monster_hurt1: "characters/monster_slime4.png" 2.0 # Shake back and forth image monster_idle2: "characters/monster_goblin1.png" 2.0 "characters/monster_goblin2.png" 0.1 #Move forward "characters/monster_goblin3.png" 0.1 "characters/monster_goblin1.png" #Move backwards again 0.2 image monster_attack2: "characters/monster_goblin1.png" 2.0 "characters/monster_goblin2.png" 0.1 #Move forward "characters/monster_goblin3.png" 0.1 "characters/monster_goblin1.png" #Move backwards again 0.2 image monster_hurt2: "characters/monster_goblin4.png" 2.0 # Shake back and forth init python: ## ------------ Love Points Activation Code------------------- #This controls when the love-points floater appears. show_playerHP=False show_monsterHP=False ## ------------ Love Points Floating Meter -------------------- def stats_overlay(): # --- Giselle's Love Bar ------- if show_playerHP: ui.frame( xpos = 10, #centered ypos = 10,) #10 px Down from the Top ui.vbox(xalign = 0.5) ui.text ("Player HP: %d" %HP, xalign = 0.5) ui.text ("Re rolls: %d" %re_roll, xalign = 0.8) ui.bar(max_HP, HP, style="my_bar") ui.close() if show_monsterHP: ui.frame( xpos = 460, #centered ypos = 10,) #10 px Down from the Top ui.vbox(xalign = 0.5) ui.text ("Monsters HP: %d" %monster_HP, xalign = 0.5) ui.bar(monster_max_HP, monster_HP, style="my_bar") ui.close() config.overlay_functions.append(stats_overlay) ## ------------ Define monsters animations------------------- monster_animation = 1 # defoult value for monster animation def monster_hurt(st, at): # define what moster is to be shown depending on what monster your facing return LiveComposite( (400, 600), # image size (200, 0), "monster_hurt%d"%monster_animation, #Ofsett 200 px, then call for monster image depending on moster you face ),.1 def monster_idle(st, at): return LiveComposite( (400, 600), (200, 0), "monster_idle%d"%monster_animation, ),.1 def monster_attack(st, at): return LiveComposite( (400, 600), (200, 0), "monster_attack%d"%monster_animation, ),.1 init: image bg forest = "forest_int.png" image y tough = im.Scale("characters/You_serious.png", 160, 500) #(y, x) image y hurt = im.Scale("characters/You_hurt.png", 160, 500) image monster normal = DynamicDisplayable(monster_idle) # using DynamicDisplayable ensures that any changes are visible immedietly image monster attack = DynamicDisplayable(monster_attack) # using DynamicDisplayable ensures that any changes are visible immedietly image monster hurt = DynamicDisplayable(monster_hurt) # using DynamicDisplayable ensures that any changes are visible immedietly $ character = Character('Zink', color="#c8ffc8") $ enemy = Character('Monster', color="#c8ffc8") label start: $ dice_1_poss = Position(xpos=.01, xanchor=0, ypos=.14, yanchor=0) $ dice_2_poss = Position(xpos=.11, xanchor=0, ypos=.14, yanchor=0) $ dice_3_poss = Position(xpos=.21, xanchor=0, ypos=.14, yanchor=0) $ dice_4_poss = Position(xpos=.31, xanchor=0, ypos=.14, yanchor=0) $ dice_5_poss = Position(xpos=.06, xanchor=0, ypos=.28, yanchor=0) $ dice_6_poss = Position(xpos=.16, xanchor=0, ypos=.28, yanchor=0) $ dice_7_poss = Position(xpos=.26, xanchor=0, ypos=.28, yanchor=0) $ monster_dice_1_poss = Position(xpos=.9, xanchor=0, ypos=.14, yanchor=0) $ monster_dice_2_poss = Position(xpos=.8, xanchor=0, ypos=.14, yanchor=0) $ monster_dice_3_poss = Position(xpos=.7, xanchor=0, ypos=.14, yanchor=0) $ monster_dice_4_poss = Position(xpos=.6, xanchor=0, ypos=.14, yanchor=0) $ monster_dice_5_poss = Position(xpos=.85, xanchor=0, ypos=.28, yanchor=0) $ monster_dice_6_poss = Position(xpos=.75, xanchor=0, ypos=.28, yanchor=0) $ monster_dice_7_poss = Position(xpos=.65, xanchor=0, ypos=.28, yanchor=0) $ experience = 0 $ level = 1 $ klass = "none" $ player_status = "none" ####################################################################################### #### combat values sett ############################################################### ####################################################################################### $ diplomatic_xp = 0 $ battle_continue = True $ player_turn = "none" $ random_monster = "none" $ blocking = 0 $ heal = 0 $ damage = 0 $ first_round = "none" $ status_dice_check = 0 ####################################################################################### #### Your dice pool ################################################################### ####################################################################################### $ dice_1 = "none" $ dice_2 = "none" $ dice_3 = "none" $ dice_4 = "none" $ dice_5 = "none" $ dice_6 = "none" $ dice_7 = "none" $ re_roll_dice1 = True $ re_roll_dice2 = True $ re_roll_dice3 = True $ re_roll_dice4 = True $ re_roll_dice5 = True $ re_roll_dice6 = True $ re_roll_dice7 = True $ dice_1_status = "none" $ dice_2_status = "none" $ dice_3_status = "none" $ dice_4_status = "none" $ dice_5_status = "none" $ dice_6_status = "none" $ dice_7_status = "none" $ sword_dice = 0 $ combo_dice = 0 $ shield_dice = 0 $ magic_dice = 0 $ talk_dice = 0 $ hart_dice = 0 $ re_roll_toggle = 0 $ re_roll_menu = True $ re_roll = 2 $ dice_remove = "none" $ dice_used = 0 ####################################################################################### #### Skills to unlock ################################################################# ####################################################################################### $ skill_shield_smash = True $ skill_heal = True $ skill_fire_ball = True ####################################################################################### #### Monster dice pool ################################################################ ####################################################################################### $ target_enemie = "none" $ monster_experience = 0 $ monster_status = "none" ### move status check to when you attack!? $ monster_dice_1 = "none" $ monster_dice_2 = "none" $ monster_dice_3 = "none" $ monster_dice_4 = "none" $ monster_dice_5 = "none" $ monster_dice_6 = "none" $ monster_dice_7 = "none" $ monster_dice_1_status = "none" $ monster_dice_2_status = "none" $ monster_dice_3_status = "none" $ monster_dice_4_status = "none" $ monster_dice_5_status = "none" $ monster_dice_6_status = "none" $ monster_dice_7_status = "none" $ re_roll_monster_dice1 = True $ re_roll_monster_dice2 = True $ re_roll_monster_dice3 = True $ re_roll_monster_dice4 = True $ re_roll_monster_dice5 = True $ re_roll_monster_dice6 = True $ re_roll_monster_dice7 = True $ sword_monster_dice = 0 $ combo_monster_dice = 0 $ shield_monster_dice = 0 $ magic_monster_dice = 0 $ talk_monster_dice = 0 $ hart_monster_dice = 0 ################################################### ## BATTLE START ################################### ################################################### "Wellcome to test demo!" menu: "Chose class!" "Warrior": $ klass = "warrior" "Bard": $ klass = "bard" "Mage": $ klass = "mage" "Cleric": $ klass = "cleric" "Rouge": $ klass = "rouge" $ random_monster = renpy.random.choice('goblin') if random_monster "slime": call slime if random_monster "goblin": call goblin $ first_round = renpy.random.choice('monster') if first_round "player": $ player_turn = "player" if first_round "monster": $ player_turn = "monster" call battle_engine if player_turn "victory": "You have vanquished the %(target_enemie)s!" "You gain %(monster_experience)d EXP!" $ experience += monster_experience elif player_turn "diplomatic_victory": "The %(target_enemie)s retreets!" $ diplomatic_xp = monster_experience/2 $ experience += diplomatic_xp "You gain %(diplomatic_xp)d EXP!" call level_upp # if level up: $ HP = max_HP,,, add to level_upp label menu: "you want full heal?" "Yes": $ HP = max_HP "No": pass "And back to start." jump start label game_over: "Game Over!" return